package com.xy.ext;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/4/10 11:13
 * @description
 */

@Component
public class MyBeanFactoryPostProcess implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        System.out.println("MyBeanFactoryPostProcess===>postProcessBeanFactory");
        int count = beanFactory.getBeanDefinitionCount();
        System.out.println("beanCount = " + count);
        String[] names = beanFactory.getBeanDefinitionNames();
        for (String name : names) {
            System.out.println("name = " + name);
        }
    }
}
